﻿using System;
using System.Linq;

namespace MyHome.Server.PluginBase
{
    /// <summary>
    /// A connection between two <see cref="IPLugin" />s
    /// </summary>
    /// <typeparam name="T">The type of data to be forwarded by this connection</typeparam>
    public interface IPluginConnection<T>
    {
        /// <summary>
        /// Gets or sets the unique identifier.
        /// </summary>
        /// <value>
        /// The unique identifier.
        /// </value>
        int Id { get; set; }

        /// <summary>
        /// Gets or sets the input for this connection.
        /// </summary>
        /// <value>
        /// The input to connect to.
        /// </value>
        IInputPlugin<T> Input { get; set; }

        /// <summary>
        /// Gets or sets the output for this connection.
        /// </summary>
        /// <value>
        /// The output to connect to.
        /// </value>
        IOutputPlugin<T> Output { get; set; }

        /// <summary>
        /// Gets or sets the input identifier.
        /// </summary>
        /// <value>
        /// The input identifier.
        /// </value>
        int InputId { get; set; }

        /// <summary>
        /// Gets or sets the output identifier.
        /// </summary>
        /// <value>
        /// The output identifier.
        /// </value>
        int OutputId { get; set; }
    }
}